<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script>
	function chk1(input){
		var reg = /.+/;
		if(reg.test(input.value)){
			document.getElementById("t1help").innerHTML = "valied";
		}else{
			document.getElementById("t1help").innerHTML = "false";
		}
	}
	
	function chk2(input){
		var reg = /\w+/;
		if(reg.test(input.value)){
			document.getElementById("t2help").innerHTML = "valied";
		}else{
			document.getElementById("t2help").innerHTML = "false";
		}
	}
</script>
</head>
<body>
<form name="f1">
	pattern:.<input type="text" name="t1" id="t1" onblur="chk1(this)"> <span id="t1help"></span><br>
	pattern:\w<input type="text" name="t1" id="t1" onblur="chk2(this)" > <span id="t2help"></span><br>	
	
</form>


</body>
</html>